#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include "base64.h"

int main(int argc, char *argv[]) {
  unsigned char text[256] = { 0 };
  unsigned char encode[500] = { 0 };
  unsigned char decode[500] = { 0 };
  int enclen, declen;
  for (int i = 0; i < 256; i++) {
	  text[i] = i;
  }
  enclen = base64_enclen((int)sizeof(text));
  printf("Encode evaluate size: %d\n", enclen);

  enclen = base64_encode(encode, text, (int)sizeof(text));
  printf("Encode real size: %d\n", enclen);

  declen = base64_declen(enclen);
  printf("Decode evaluate size: %d\n", declen);

  declen = base64_decode(decode, encode, enclen);
  printf("Decode real size: %d\n", declen);

  printf("Encode: %s\n", encode);
  for (int i = 0; i < declen; i++) {
	  printf("Decode: %d\n", decode[i]);
  }
}
